package com.example.module_main.loading

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.example.module_main.R

class Vip2Adapter : RecyclerView.Adapter<Vip2Adapter.ViewHolder>() {
    private val pageData = listOf(
        GuidePage(R.drawable.pou3),
        GuidePage(R.drawable.pou3),
        GuidePage(R.drawable.pou3)
    )
    inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
        fun bind(page: GuidePage) {
            itemView.setBackgroundResource(page.imageRes)
        }
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
        val view = LayoutInflater.from(parent.context)
            .inflate(R.layout.vip2_item, parent, false)
        return ViewHolder(view)
    }

    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
        holder.bind(pageData[position])
    }

    override fun getItemCount(): Int = pageData.size
}

data class GuidePage(
    val imageRes: Int,
)